home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / areuh.tar / areuh / cpy / a2rs.c < prev    next >
C/C++ Source or Header  |  1990-10-10  |  813b  |  48 lines

  1. /*
  2.  * Authors :
  3.  *   Pierre DAVID (pda@masi.ibp.fr or pda@frunip62.bitnet)
  4.  *   Janick TAILLANDIER
  5.  *
  6.  * This program can be freely used or distributed as long as this
  7.  * note is kept.
  8.  *
  9.  * This program is provided "as is".
  10.  */
  11.  
  12. #include "copy.h"
  13. #include <dos.h>
  14.  
  15. union REGS inregs, outregs ;
  16.  
  17. init ()
  18. {
  19.     inregs.h.ah = 0 ;
  20.     inregs.h.al = 0xe3 ;
  21.     inregs.x.dx = 0 ;            /* com1 */
  22.     int86 (0x14, &inregs, &outregs) ;
  23. }
  24.  
  25. output (c)
  26. char c ;
  27. {
  28.     int ok ;
  29.  
  30.     ok = 0 ;
  31.     while (!ok)
  32.     {
  33.     inregs.h.ah = 0x03 ;            /* get line status */
  34.     inregs.x.dx = 0x0000 ;
  35.     int86 (0x14, &inregs, &outregs) ;
  36.     ok = (outregs.h.al & 0x30) == 0x30 ;    /* handshake lines */
  37.     }
  38.     inregs.h.ah = 1 ;                /* send char */
  39.     inregs.h.al = c ;
  40.     inregs.x.dx = 0 ;
  41.  
  42.     int86 (0x14, &inregs, &outregs) ;
  43. }
  44.  
  45. term ()
  46. {
  47. }
  48.